﻿using Microsoft.Extensions.Configuration;

namespace 自定义配置系统
{
    public class TestController
    {
        private readonly IConfiguration config;
        public TestController(IConfiguration configuration) 
        { 
            config=configuration; 
        }
        public void Test()
        {
            string addr = config["Address"];
            string port = config.GetSection("Port").Value;
            Console.WriteLine($"Address={addr}");
            Console.WriteLine($"Port={port}");
        }
    }
}
